Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: datepicker disabled state change is unstable #466

Conversation

malikov917
Copy link
Contributor

@malikov917 malikov917 commented Feb 26, 2024

What:
Bug fix for the datepicker.

Steps to reproduce old behavior:

  1. Create a checkbox and a datepicker
  2. Set [disabled] attribute to depend on a checkbox. Can be like a reference on a checkbox: #checkbox.checked.
  3. Checkbox is set as true
  4. Try to click twice on a checkbox fast (might require some attempts)
    Expected result:
    datepicker is working (clickable, date can be picked)
    Actual result:
    datepicker is broken. Calendar is not shown, date can't be picked.

Additional info:
Any other approach of using API didn't work as expected. I tried to combine 'disable', 'allowInput' from https://flatpickr.js.org/options/ but nothing worked well. So I accessed altInput which I used to implement the logic.

datepicker-26
(on the gif you can see like after clicking twice on a checkbox datepicker stopped opening)

@malikov917 malikov917 merged commit d287f49 into main Feb 27, 2024
6 checks passed
@malikov917 malikov917 deleted the feature/COYOFOUR-22302-datepicker-disabled-state-change-is-unstable branch February 27, 2024 07:34
@github-actions github-actions bot mentioned this pull request Feb 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant